
import pandas as pd

def fun1():
    df = pd.read_csv('../nba.csv')
    print(df.to_string())

def fun2():
    df = pd.read_csv('../nba.csv')
    print(df)

def fun3():
    # 三个字典 name site age
    name = ["Google", "Runoob", "Taobao", "Wiki"]
    site = ["www.google.com", "www.runoob.com", "www.taobao.com", "www.wikipedia.org"]
    age = [90, 40, 80, 98]

    # 字典
    dict = {'name': name, 'site': site, 'age': age}
    df = pd.DataFrame(dict)

    # 保存dataframe
    df.to_csv('../site.csv')

# head(n)用于读取前面的n行，默认5行
def fun4():
    df = pd.read_csv('../nba.csv')
    print(df.head())

# 读取前面10行
def fun5():
    df = pd.read_csv('../nba.csv')
    print(df.head(10))

# tail(n)用于读取尾部的n行，默认5行
def fun6():
    df = pd.read_csv('../nba.csv')
    print(df.tail())

def fun7():
    df = pd.read_csv('../nba.csv')
    print(df.tail(10))

# info()返回表格的一些基本信息
def fun8():
    df = pd.read_csv('../nba.csv')
    print(df.info())

if __name__ == '__main__':
    fun8()